import { isTauri } from "@/utils";
import type { CompKey } from "@/config/components";

const featureConfig: Array<featureDateType<CompKey>> = [
  {
    title: "加密工具",
    titleIcon: "icon-gongjuxiang",
    children: [
      { label: "MD5加密", name: "Md5" },
      { label: "Base64加解密", name: "Base64" },
      {
        label: "RSA加解密",
        name: "RSA",
        descript: "使用公钥进行加密, 使用私钥进行解密"
      },
      // { label: "AES加解密", name: "AES" }
    ]
  },
  {
    title: "文本工具",
    titleIcon: "icon-jiegousheji",
    children: [
      { label: "Markdown", name: "Markdown" },
      { label: "JSON可视化", name: "JsonVisual" },
      { label: "JSON转Type", name: "JsonToType" },
      { label: "字面量类型生成", name: "TextToUnionType" },
      { label: "Diff文本", name: "Diff" },
      { label: "代码编辑器", name: "WebEditor" },
      { label: "正则表达式", name: "RegExp" }
    ]
  },
  {
    title: "计算工具",
    titleIcon: "icon-jisuan",
    children: [
      { label: "亲戚关系计算", name: "RelationCalc" },
      { label: "大写数字", name: "UppercaseCalc" }
      // { label: "汇率计算", name: "ExchangeRateCalc" },
    ]
  },
  {
    title: "其他工具",
    titleIcon: "icon-tandem",
    children: [
      { label: "JS混淆", name: "JsConfuse" },
      { label: "图片Base64互转", name: "ImgConvertBase64" },
      { label: "生成二维码", name: "GenerateQrcode" },
      {
        label: "画板",
        name: "DrawingBoard",
        descript: "TODO: 使用 range input 改变线条大小会导致不明的偏移量, 画布移动问题"
      },
      { label: "视频播放", name: "WebVideo", descript: "TODO: 无法播放本地视频" }
      // { label: "截图", name: "RelationCalc" }, // kscreenshot
      // { label: "ACE", name: "ACE" }, // vue3-ace-editor
    ]
  },
  {
    title: "系统工具",
    titleIcon: "icon-fuzhugongju",
    isTauri: true,
    children: [
      // { label: "多功能截图", type: "JT" },
      // { label: "取色器", type: "QS" }
      { label: "文字识别", name: "OCR" },
      { label: "文件操作", name: "FileOperator" }
    ]
  }
];

if (!isTauri()) {
  const idx = featureConfig.findIndex(e => e.isTauri);
  if (idx !== -1) featureConfig.splice(idx, 1);
}

export { featureConfig };
